var express = require('express');
var app = express();

app.use(express.static('page'));

app.get('/redbag', function(req, res) {
    res.sendFile(__dirname + '/page/zxkg_redbag/redbag.html');
});

app.get('/confirm', function(req, res) {
    res.sendFile(__dirname + '/page/zxkg-confirm-debt/debt-confirm.html');
});
app.get('/', function(req, res) {
    res.redirect('/redbag');
});

app.post('/data', function(req, res) {
    var data = {
        list: [{
            cash: '100.00元',
            title: '红包',
            getTime: {
                date: '2015-09-30',
                time: '18:40:30'
            },
            activeTime: {
                date: '2015-09-30',
                time: '18:40:30'
            },
            overdueTime: {
                date: '2015-09-30',
                time: '18:40:30'
            },
            minCash: '100.00元',
            from: '平台奖励',
            status: '已过期'
        }, {
            cash: '100.00元',
            title: '红包',
            getTime: {
                date: '2015-09-30',
                time: '18:40:30'
            },
            activeTime: {
                date: '2015-09-30',
                time: '18:40:30'
            },
            overdueTime: {
                date: '2015-09-30',
                time: '18:40:30'
            },
            minCash: '100.00元',
            from: '平台奖励',
            status: '已过期'
        }, {
            cash: '100.00元',
            title: '红包',
            getTime: {
                date: '2015-09-30',
                time: '18:40:30'
            },
            activeTime: {
                date: '2015-09-30',
                time: '18:40:30'
            },
            overdueTime: {
                date: '2015-09-30',
                time: '18:40:30'
            },
            minCash: '100.00元',
            from: '平台奖励',
            status: '已过期'
        }]
    };
    res.json(data);
});

app.listen(3000);
